﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ResourceViewerExtension
{
    /// <summary>
    /// Interaction logic for MainView.xaml
    /// </summary>
    public partial class MainView : UserControl
    {
        public MainView()
        {
            InitializeComponent();
            this.DataContext = MainViewModel.Instance;
        }

        private void ExpandCollapseDetailsButton_Click(object sender, RoutedEventArgs e)
        {
            if (DetailsRowDefinition.ActualHeight > 17)
                DetailsRowDefinition.Height = new GridLength(17);
            else if (DetailsRowDefinition.ActualHeight < 100)
                DetailsRowDefinition.Height = new GridLength(100);
        }

        private void DetailsHeaderContainer_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (DetailsRowDefinition.ActualHeight < 100)
                DetailsRowDefinition.Height = new GridLength(100);
        }
    }
}
